#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>



int removeElement(int* nums, int numsSize, int val)
{
	int src = 0;
	int dst = 0;

	while (src < numsSize)
	{
		if (nums[src] != val)
		{
			nums[src++] = nums[dst++];
		}
		else
		{
			src++;
		}
	}

	return dst;
}


int main()
{
	int a[10] = { 0,1,2,2,3,4,5,2,6,2 };
	int size = sizeof(a) / sizeof(a[0]);
	int val = 2;
	int ret = removeElement(a, size, val);
	printf("%d ", ret);
	return 0;
}